﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using AspNetCoreTest.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Data;
using System.Data.SqlClient;
using Dapper;
using MySql.Data.MySqlClient;
using RefitService;
using AspNetCoreTest.HttpServices;

namespace AspNetCoreTest.Controllers
{
    [ApiController]
    [Route("[controller]/[action]")]
    public class UserController : ControllerBase
    {
        private IUserHttpService _userHttpService;
        private ITestInjectHttpService _testInjectHttpService;
        private TestNullHttpService _testNullHttpService;

        public UserController(IUserHttpService userHttpService, ITestInjectHttpService testInjectHttpService, TestNullHttpService testNullHttpService)
        {
            _userHttpService = userHttpService;
            _testInjectHttpService = testInjectHttpService;
            _testNullHttpService = testNullHttpService;
        }

        public async Task<dynamic> Get(string phone = "18520314190")
        {
            return await _userHttpService.GetUserByPhone(phone);
        }

        public async Task<dynamic> Test()
        {
            var a = _testInjectHttpService;
            var b = _testNullHttpService;
            return 1;
        }
    }
}
